package com.zx.idc.backend.gui.scheduler.report.illegalinfo;

import com.zx.idc.common.spring.SpringBeanUtil;
import com.zx.idc.ds.report.rillegalinfo.service.IRIllegalInfoDayService;
import org.quartz.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * 统计违法信息日报Job
 * 注意：由于数据源依赖关系的存在， 违法信息统计job 应该配置发生在 <新的url爬虫job> job之后
 */
@PersistJobDataAfterExecution
@DisallowConcurrentExecution
public class RIllegalInfoDayJob implements Job {

    private static final Logger LOG = LoggerFactory.getLogger(RIllegalInfoDayJob.class);

    @Autowired
    private IRIllegalInfoDayService illegalInfoDayService;

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        LOG.info("Aggregate illegal information daily report job start...");
        illegalInfoDayService.aggregate();
        LOG.info("Aggregate illegal information daily report job done.");
    }

}
